<!DOCTYPE HTML>
<html lang="en">
<head>
<meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2011. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
<meta charset="utf-8">
<link rel="STYLESHEET" href="../book.css" type="text/css">
<script src="PLUGINS_ROOT/org.eclipse.help/livehelp.js"></script>
<title>Defining a custom IntroURL action</title>
</head>
<body>

<h2>Defining a Custom IntroURL Action</h2>

<p>
Using the <b><a href="../reference/extension-points/org_eclipse_ui_intro_configExtension.html">org.eclipse.ui.intro.configExtension</a></b>
extension point, plug-ins can contribute their own custom actions that can be used as a <b>url</b> value for a link element in a page.
For example, consider the following link:
</p>
<p><code>http://org.eclipse.ui.intro/runAction?pluginId=org.eclipse.pde.ui&amp;amp;class=org.eclipse.pde.ui.internal.samples.ShowSampleAction&amp;amp;id=org.eclipse.sdk.samples.swt.examples</code></p>
<p>This IntroURL will run an action class called <b>ShowSampleAction</b>, which is in a package "org.eclipse.pde.ui.internal.samples" in the plug-in
"org.eclipse.pde.ui".  The id of the sample to run is "org.eclipse.sdk.samples.swt.examples".
</p>
<p>To define a custom version of this intro URL, you can use the following markup:</p>

<pre>
   &lt;extension point="org.eclipse.ui.intro.configExtension"&gt;
      &lt;action
            name="myCommand"
            <b>replaces="runAction?pluginId=org.eclipse.pde.ui&amp;amp;class=org.eclipse.pde.ui.internal.samples.ShowSampleAction"</b>&gt;
      &lt;/action&gt;
   &lt;/extension&gt;
</pre>

With the above extension you can now use the following URL to run the same action:
<p><code>http://org.eclipse.ui.intro/myCommand?id=org.eclipse.sdk.samples.swt.examples</code></p>
<p>
The action "myCommand" will be replaced by the value of the <b>replaces</b> attribute and any remaining URL
parameters will be appended to the end.  Once the substitution is made, the resulting URL will be expanded back into:</p>
<p><code>http://org.eclipse.ui.intro/runAction?pluginId=org.eclipse.pde.ui&amp;amp;class=org.eclipse.pde.ui.internal.samples.ShowSampleAction&amp;amp;id=org.eclipse.sdk.samples.swt.examples</code></p>

</body>
</html>
